#ifndef FUNCTIONS_H
#define FUNCTIONS_H
#include <pcl/point_types.h>


using namespace std;
using namespace pcl;


/*!
 \brief

 \param cloud
 \param threshold
 \param minClusterSize
 \param maxClusterSize
 \return vector<PointIndices>
*/
vector<PointIndices> findClusters(PointCloud<pcl::PointXYZ>::Ptr cloud, double threshold, int minClusterSize, int maxClusterSize=0);
/*!
 \brief

 \param cloud
 \param threshold
 \param minClusterSize
 \param maxClusterSize
 \return vector<PointIndices>
*/
vector<PointIndices> findClusters(PointCloud<pcl::PointXYZI>::Ptr cloud, double threshold, int minClusterSize, int maxClusterSize=0);

/*!
 \brief

 \param inputCloud
 \param outputCloud
 \param clusterThreshold
*/
void keepHalfClusters(PointCloud<PointXYZI>::Ptr inputCloud,PointCloud<PointXYZI>::Ptr outputCloud,double clusterThreshold);

/*!
 \brief

 \param inputCloud
 \param outputCloud
 \param clusterThreshold
 \param min
 \param max
*/
void keepBiggestCluster(PointCloud<PointXYZI>::Ptr inputCloud,PointCloud<PointXYZI>::Ptr outputCloud,double clusterThreshold,int min,int max);

/*!
 \brief

 \param cloud
 \param nVoxelsRequired
 \return float
*/
float computeLeafSize (PointCloud<PointXYZ>::Ptr cloud, int nVoxelsRequired);

/*!
 \brief

 \param cloud
 \param normals
 \param radius
*/
void onlyNormals(PointCloud<PointXYZ>::Ptr cloud  ,   PointCloud<Normal>::Ptr normals , double radius);
/*!
 \brief

 \param cloud
 \param normals
 \param radius
*/
void onlyNormals(PointCloud<PointXYZI>::Ptr cloud  ,   PointCloud<Normal>::Ptr normals , double radius);

/*!
 \brief

 \param source
 \param target
 \param differences
 \param distanceThreshold
*/
void segmentDifferences(PointCloud<PointXYZ>::Ptr source,PointCloud<PointXYZ>::Ptr target,PointCloud<PointXYZ>::Ptr differences,double distanceThreshold);

#endif
